<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link rel="stylesheet" href="resources/css/style.css"/>
<style type="text/css">
#reportT table td {
	border: 1px solid #dddddd;
}
#winnerT td {
	border: 1px solid #dddddd;
}
</style>

<title>꽁알: Administrator</title>
</head>
<body>
<!-- 차트 -->

<!-- 타겟별 수 -->
<h3>▶ 분석</h3>
<table id="reportT" style="width:100%;">
	<tr>
		<td style="width:20%;" valign="top">
			<table style="width:90%;text-align:center;" cellspacing="0" cellpadding="5">
				<tr class="table_title">
					<td colspan="2">결혼유무</td>
				</tr>
			<c:forEach var="list" items="${marryList }">
				<tr>
					<td style="width:50%">
						<c:if test="${list.t_name == 'true' }">기혼</c:if> 
						<c:if test="${list.t_name == 'false' }">미혼</c:if>
					</td>
					<td>${list.t_count }</td>
				</tr>
			</c:forEach>
			</table>
		</td>
		
		<td style="width:20%;" valign="top">
			<table style="width:90%;text-align:center;" cellspacing="0" cellpadding="5">
				<tr class="table_title">
					<td colspan="2">성별</td>
				</tr>
			<c:forEach var="list" items="${sexList }">
				<tr>
					<td style="width:50%">
						<c:if test="${list.t_name == 'man' }">남자</c:if>
						<c:if test="${list.t_name == 'woman' }">여자</c:if>
					</td>
					<td>${list.t_count }</td>
				</tr>
			</c:forEach>
			</table>
		</td>
		
		<td style="width:20%;" valign="top">
			<table style="width:90%;text-align:center;" cellspacing="0" cellpadding="5">
				<tr class="table_title">
					<td colspan="2">나이</td>
				</tr>
			<c:forEach var="list" items="${ageList }" varStatus="stat">
			<c:if test="${stat.index < 5 }">
				<tr>
					<td style="width:50%">${list.t_name }</td>
					<td>${list.t_count }</td>
				</tr>
			</c:if>
			</c:forEach>
			</table>
		</td>
		
		<td style="width:20%;" valign="top">
			<table style="width:90%;text-align:center;" cellspacing="0" cellpadding="5">
				<tr class="table_title">
					<td colspan="2">지역</td>
				</tr>
			<c:forEach var="list" items="${areaList }" varStatus="stat">
			<c:if test="${stat.index < 5 }">
				<tr>
					<td style="width:50%">${list.t_name }</td>
					<td>${list.t_count }</td>
				</tr>
			</c:if>
			</c:forEach>
			</table>
		</td>
		
		<td style="width:20%;" valign="top">
			<table style="width:90%;text-align:center;" cellspacing="0" cellpadding="5">
				<tr class="table_title">
					<td colspan="2">직업</td>
				</tr>
			<c:forEach var="list" items="${jobList }" varStatus="stat">
			<c:if test="${stat.index < 5 }">
				<tr>
					<td style="width:50%">${list.t_name }</td>
					<td>${list.t_count }</td>
				</tr>
			</c:if>
			</c:forEach>
			</table>
		</td>
	</tr>
</table>
<br/>

<!-- 당첨자 리스트 -->
<h3>▶ 당첨자 리스트</h3>
<table id="winnerT" cellspacing="0" cellpadding="5" align="center" style="text-align:center;width:100%;">
	<tr class="table_title">
		<td>순위</td>
		<td>날짜</td>
		<td>당첨자ID</td>
		<td>주소</td>
		<td>상세주소</td>
		<td>우편번호</td>
		<td>전화번호</td>
		<td>경품번호(ID)</td>
		<td>경품종류</td>
		<td>경품명</td>
	</tr>
	<c:forEach var="list" items="${winnerList }">
		<tr>
			<td>${list.rank }</td>
			<td>${list.gamestarttime }</td>
			<td>${list.id }</td>
			<td>${list.address_1 }</td>
			<td>${list.address_2 }</td>
			<td>${list.zip }</td>
			<td>${list.pnum }</td>
			<td>${list.giftId }</td>
			<td>${list.giftType }</td>
			<td>${list.giftName }</td>
		</tr>
	</c:forEach>
</table>
<br/>
<table align="center" style="text-align:center;">
	<tr>
		<td>
			<input type="button" value="닫기"
				style="width:80px;height:24px;"
				onclick="self.close()"
			/>
		</td>
	</tr>
</table>

</body>
</html>